using UnityEngine;

public class MovePosition : MonoBehaviour
{
	public Vector3 moving;

	private Vector3 startPosition;

	public float coefForMoving;

	private int mult = 1;

	private void Start()
	{
		startPosition = base.transform.position;
	}

	private void Update()
	{
		if (startPosition.y + moving.y < base.transform.position.y)
		{
			mult = -1;
		}
		else if (startPosition.y - moving.y > base.transform.position.y)
		{
			mult = 1;
		}
		base.transform.position += Vector3.up * coefForMoving * mult;
	}
}
